package com.jakewharton.rxbinding4.component;

import com.google.auto.value.AutoValue;

import io.reactivex.rxjava3.annotations.NonNull;
import ohos.agp.components.TimePicker;
import ohos.app.Context;

/**
 * A text-change event on a view.
 * <p>
 * <strong>Warning:</strong> Instances keep a strong reference to the view. Operators that cache
 * instances have the potential to leak the associated {@link Context}.
 */
@AutoValue
public abstract class TimePickerTimeChangeEvent {
    /**
     * Create time picker time change event
     *
     * @param view   view
     * @param hour   hour
     * @param minute minute
     * @param second second
     * @return the time picker time change event
     */
    @NonNull
    public static TimePickerTimeChangeEvent create(@NonNull TimePicker view, int hour, int minute, int second) {
        return new AutoValue_TimePickerTimeChangeEvent(view, hour, minute, second);
    }

    /**
     * Time picker time change event
     */
    TimePickerTimeChangeEvent() {}

    /**
     * The view from which this event occurred.
     *
     * @return the time picker
     */
    @NonNull
    public abstract TimePicker view();

    /**
     * Hour int
     *
     * @return the int
     */
    public abstract int hour();

    /**
     * Minute int
     *
     * @return the int
     */
    public abstract int minute();

    /**
     * Second int
     *
     * @return the int
     */
    public abstract int second();
}
